package com.orhon.smartcampus.modules.baseinfo.fetcher;

import com.orhon.smartcampus.modules.baseinfo.mutation.*;
import graphql.schema.idl.RuntimeWiring;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class BaseInfoFetcherLoader {
	
	@Autowired
	SchoolCalendarDayFetcher schoolCalendarDayFetcher;
    @Autowired
    SchoolCalendarDaysFetcher schoolCalendarDaysFetcher;
    
    @Autowired
    SchoolCalendarWeekFetcher schoolCalendarWeekFetcher;
    @Autowired
    SchoolCalendarWeeksFetcher schoolCalendarWeeksFetcher;


	@Autowired
	TimetableItemFetcher timetableItemFetcher;
    @Autowired
    TimetablesItemsFetcher timetableItemsFetcher;
    
	@Autowired
	TimetableFetcher timetableFetcher;
    @Autowired
    TimetablesFetcher timetablesFetcher;
    
	@Autowired
    SemestersFetcher semestersFetcher;
    @Autowired
    SemesterFetcher SemesterFetcher;

    @Autowired
    MessageCategoryFetcher messageCategoryFetcher;
    @Autowired
    MessageCategorysFetcher messageCategorysFetcher;
    @Autowired
    MessageCategoryValidationFetcher messageCategoryValidationFetcher;

    @Autowired
    WeChatTemplatesFetcher weChatTemplatesFetcher;
    @Autowired
    WeChatTemplateFetcher weChatTemplateFetcher;

    @Autowired
    AddSemesterMutation addSemesterMutation;

    @Autowired
    DeleteSemesterMutation deleteSemesterMutation;

    @Autowired
    AddTimetableMutation addTimetableMutation;

    @Autowired
    DeleteTimetableMutation deleteTimetableMutation;

    @Autowired
    AddTimetableItemMutation addTimetableItemMutation;

    @Autowired
    DeleteTimetableItemMutation deleteTimetableItemMutation;

    @Autowired
    InitSchoolCalendarMutation initSchoolCalendarMutation;

    @Autowired
    EditSchoolCalendarDayMutation editSchoolCalendarDayMutation;

    @Autowired
    AddMessageCategoryMutation addMessageCategoryMutation;

    @Autowired
    DeleteMessageCategoryMutation deleteMessageCategoryMutation;

    @Autowired
    AddWeChatTemplateMutation addWeChatTemplateMutation;
    @Autowired
    DeleteWeChatTemplateMutation deleteWeChatTemplateMutation;



    public void LoadFetchers(RuntimeWiring.Builder builder){
    	
    	builder.type("Query" , t->t.dataFetcher("schoolCalendarDay",schoolCalendarDayFetcher));
    	builder.type("Query" , t->t.dataFetcher("schoolCalendarDays" ,schoolCalendarDaysFetcher));
    	
    	builder.type("Query" , t->t.dataFetcher("schoolCalendarWeek",schoolCalendarWeekFetcher));
    	builder.type("Query" , t->t.dataFetcher("schoolCalendarWeeks" ,schoolCalendarWeeksFetcher));

        builder.type("Query" , t->t.dataFetcher("messageCategory",messageCategoryFetcher));
        builder.type("Query" , t->t.dataFetcher("messageCategorys" ,messageCategorysFetcher));
        builder.type("Query" , t->t.dataFetcher("messageCategoryValidation" ,messageCategoryValidationFetcher));
        builder.type("Query" , t->t.dataFetcher("weChatTemplate" ,weChatTemplateFetcher));
        builder.type("Query" , t->t.dataFetcher("weChatTemplates" ,weChatTemplatesFetcher));

    	builder.type("Query" , t->t.dataFetcher("Timetables",timetablesFetcher));
    	builder.type("Query" , t->t.dataFetcher("Timetable" ,timetableFetcher));
    	builder.type("Query" , t->t.dataFetcher("TimetableItems",timetableItemsFetcher));
    	builder.type("Query" , t->t.dataFetcher("TimetableItem" ,timetableItemFetcher));
        builder.type("Query" , t->t.dataFetcher("Semesters" ,semestersFetcher));
        builder.type("Query" , t->t.dataFetcher("Semester" ,SemesterFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addSemester" , addSemesterMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteSemester" , deleteSemesterMutation));
        builder.type("Mutation" , t->t.dataFetcher("addTimetable" , addTimetableMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteTimetable" , deleteTimetableMutation));
        builder.type("Mutation" , t->t.dataFetcher("addTimetableItem" , addTimetableItemMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteTimetableItem" , deleteTimetableItemMutation));
        builder.type("Mutation" , t->t.dataFetcher("initSchoolCalendar" , initSchoolCalendarMutation));
        builder.type("Mutation" , t->t.dataFetcher("reinitSchoolCalendar" , initSchoolCalendarMutation));
        builder.type("Mutation" , t->t.dataFetcher("editSchoolCalendarDay" , editSchoolCalendarDayMutation));
        builder.type("Mutation" , t->t.dataFetcher("addMessageCategory" , addMessageCategoryMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteMessageCategory" , deleteMessageCategoryMutation));
        builder.type("Mutation" , t->t.dataFetcher("addWeChatTemplate" , addWeChatTemplateMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteWeChatTemplate" , deleteWeChatTemplateMutation));


    }



}
